<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="HomeSyllatheque"></jsp:include>
<jsp:include page="ProduitSyllatheque"></jsp:include>
<jsp:include page="header.jsp"></jsp:include>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

    <div class="hero-unit">
        <!-- DESCRIPTION -->
        <h2><fmt:message key="titleIndex" /></h2>
        <p><fmt:message key="introIndex" /></p>
        
        <!-- CATÉGORIE - ACHAT - RECHERCHE -->
        <div class="row" style="margin: auto;">
            <div class="span-one-third-header">
                <h2><fmt:message key="littleTitleCat" /></h2>
                <ul>
                    <c:forEach var="c" items="${categorie}" >
                        <li><a href="CategorieSyllatheque?id=${c.codeId}&lib=${c.denomination}">${c.denomination}</a></li>
                    </c:forEach>
                    <li><a href="catalogue.jsp"><fmt:message key="linkIndexCat" /></a></li>
                </ul>                
            </div>
            <div class="span-one-third-header">
                <h2><fmt:message key="littleTitleRandom" /></h2>
                    <h4>${syllabus.libelle}</h4>
                    <span class="descriptionHasard">${syllabus.description}</span>
                    <ul class="listeHasard">
                        <li><fmt:message key="catVente" /> : ${syllabus.categorie.denomination}</li>
                        <li><fmt:message key="autVente" /> : ${syllabus.auteur.nom} ${syllabus.auteur.prenom}</li>
                        <li><fmt:message key="prixVente" /> : ${syllabus.prix}</li>
                    </ul>
                <p><a class="btn" href="VenteSyllatheque?id=${syllabus.syllabusId}"><fmt:message key="detailVente" /> &raquo;</a></p>
            </div>
            <div class="span-one-third-header">
                <h2><fmt:message key="littleTitleSearch" /></h2>
                <form action="RechercheSyllatheque" method="get">
                    <fieldset style="margin: -15px 0px 0px 15px;">
                        <legend><fmt:message key="legendFormSearch" /></legend>
                        <label for="motClef" style="text-align: left;"><strong><fmt:message key="labelMC" /> : </strong></label>
                        <input name="motClef" type="text" value="" tabindex="1" />
                        <br /><br />

                        <label for="categorie" style="text-align: left;"><strong><fmt:message key="labelCat" /> : </strong></label>
                        <select name="categorie" tabindex="2" style="height: 28px;">
                            <option value="all" selected="selected"><fmt:message key="labelAll" /></option>
                            <c:forEach var="c" items="${categorie}" >
                                <option value="${c.codeId}">${c.denomination}</option>
                            </c:forEach>
                        </select>
                        <br /><br />

                        <input name="submit" class="btn primary" type="submit" value="<fmt:message key="btnSearch" />" tabindex="3" />
                    </fieldset>
                </form>
            </div>
        </div>
    </div>

    <hr />
    
    <h2><fmt:message key="littleTitleSyll" /></h2>
    <!-- On affiche les 6 derniers syllabus -->
    <div class="row">
        <c:forEach var="c" items="${listSyllabus}" >
        <div class="span-one-third" style="margin-top: 15px;">
            <div class="trucBizarre">
                <h4>${c.libelle}</h4>
                <span class="descriptionHasard">${c.description}</span>
                <ul class="listeHasard">
                    <li><fmt:message key="catVente" /> : ${c.categorie.denomination}</li>
                    <li><fmt:message key="autVente" /> : ${c.auteur.nom} ${c.auteur.prenom}</li>
                    <li><fmt:message key="prixVente" /> : ${c.prix}</li>
                </ul>
            </div>
            <p><a class="btn" href="VenteSyllatheque?id=${c.syllabusId}"><fmt:message key="detailVente" /> &raquo;</a></p>
        </div>
        </c:forEach>
      </div>
    
    <p style="margin: 45px 0px 15px 0px"><fmt:message key="endIndex" /></p>

<jsp:include page="footer.jsp"></jsp:include>